package com.drinks.yiniang.common.camera.album;

import com.drinks.yiniang.entity.photo.Photos;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author han
 * @date 2019/12/21
 */
public class Setting {
    public static long minSize = 1;
    public static long maxSize = Long.MAX_VALUE;
    public static int minWidth = 1;
    public static int minHeight = 1;

    public static boolean selectMutualExclusion = false;

    public static int count = 1;
    public static int pictureCount = -1;
    public static int videoCount = -1;

    public static boolean showOriginalMenu = false;
    public static boolean originalMenuUsable = false;
    public static boolean selectedOriginal = false;
    public static boolean showGif = false;

    public static String fileProviderAuthority = null;

    public static ArrayList<Photos> selectedPhotos = new ArrayList<>();
    public static List<String> filterTypes = new ArrayList<>(Arrays.asList(Type.image()));

    //video
    public static long videoMinSecond = 0L;
    public static long videoMaxSecond = Long.MAX_VALUE;

    public static boolean isOnlyGif() {
        //Setting.filterTypes.containsAll(Arrays.asList(Type.image()))
        return Arrays.asList(Type.gif()).containsAll(Setting.filterTypes);
    }

    public static boolean isOnlyImage() {
        //Setting.filterTypes.containsAll(Arrays.asList(Type.image()))
        return Arrays.asList(Type.image()).containsAll(Setting.filterTypes);
    }

    public static boolean isOnlyVideo() {
        //Setting.filterTypes.containsAll(Arrays.asList(Type.video()))
        return Arrays.asList(Type.video()).containsAll(Setting.filterTypes);
    }

    public static boolean isAll() {
        //Setting.filterTypes.containsAll(Arrays.asList(Type.all()))
        return Arrays.asList(Type.all()).containsAll(Setting.filterTypes);
    }

    public static boolean showVideo() {
        return !isOnlyImage();
    }

    public static void clear() {
        minWidth = 1;
        minHeight = 1;
        minSize = 1;
        maxSize = Long.MAX_VALUE;
        selectMutualExclusion = false;
        count = 1;
        pictureCount = -1;
        videoCount = -1;
        selectedPhotos.clear();
        showOriginalMenu = false;
        originalMenuUsable = false;
        selectedOriginal = false;

        filterTypes = new ArrayList<>(Arrays.asList(Type.image()));
        showGif = false;

        videoMinSecond = 0L;
        videoMaxSecond = Long.MAX_VALUE;
    }
}
